.medium-zoom-overlay {
  z-index: var(--medium-zoom-z-index);

  /* override element style set by medium-zoom script */
  background-color: var(--medium-zoom-c-bg) !important;

  ~ img {
    z-index: calc(var(--medium-zoom-z-index) + 1);
  }

  /* stylelint-disable-next-line selector-class-pattern */
  .medium-zoom--opened & {
    opacity: var(--medium-zoom-opacity);
  }
}
